#include <iostream>

using namespace std;

void hanoi (int n,char a,char b,char c)
{ 
    if(n==1) cout<<a<<"->"<<c<<" ";
    else{
            hanoi(n-1,a,b,c);
            cout<<a<<"->"<<c<<endl;
            hanoi(n-1,b,a,c);
        }
}

int main( )
{
    int n;
    cin>>n;

    hanoi(n,'a','b','c');
    
    cin>>n;
    return 0;
}
